#include <stdio.h>
#include <stdlib.h>
#pragma warning(disable:4996)

#define M 16
#define N 16

int fivechess_broad(char chess[M][N], int L) //构建五子棋盘
{
        int i = 0, j = 0; L = N ;
        for (i = 0; i < L; i++) {
            for (j = 0; j < L; j++) {
                chess[i][j] = '+';  //每个位置初始化为“+”
            }
        }
}


int side_broad(int x)   //创建数字边方便下棋
{
    printf("%d", x);
    if (x < 10)
        printf("   ");
    else
        printf("  ");
}


int full_broad(char Chess[M][N], int L)  //判断是否满棋
{
    int i = 0, j = 0;
    for (i = 0; i < L; i++) {
        for (j = 0; j < L; j++) {
            if ('+' == Chess[i][j]) {
                return 0;//棋盘没满
            }
        }
    }
    return 1;//棋盘满了
}

int setdown(char Chess[M][N], int L, int x, int y, char Chesspoint) 
{
    if ((x < L) && (x >= 0) && (y < L) && (y >= 0)) {
       if ('+' == Chess[x][y]) {
           Chess[x][y] = Chesspoint;
           return 1;//成功
        }
       else{
           return 0;//失败
       }
    }
}

int view_chess(char array[M][N]) {

    int i = 0, j = 0; int L = N;
    for (i = 0; i < L; ++i) {
        side_broad(i);
    }
    printf("\n\n");
    fivechess_broad(array, N);       //打印第一行数字

    for (i = 1; i < L; i++) {
        side_broad(i);               //打印第一列数字
        for (j = 1; j < L; j++) {
            printf("%c   ", array[i][j]);//输出棋盘
        }
        printf("\n\n");
    }
    for (i = 1; i < L; i++) {
        printf("——");
    }
}


int main() {
    char array[M][N];
    char name_A[100],name_B[100];
    int x = 0, y = 0, i = 0, j = 0; int L = N;    //定义基本内容
    view_chess(array);
}

